StableSort Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied Comparison<T> delegate is used to compare the items in the collection.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static T[] StableSort<T>(
	IEnumerable<T> collection,
	Comparison<T> comparison
)
Visual Basic (Declaration)
Public Shared Function StableSort(Of T) ( _
	collection As IEnumerable(Of T), _
	comparison As Comparison(Of T) _
) As T()
Visual C++
public:
generic<typename T>
static array<T>^ StableSort (
	IEnumerable<T>^ collection, 
	Comparison<T>^ comparison
)

Parameters

collection
IEnumerable<(Of <T>)>
The collection to sort.
comparison
Comparison<(Of <T>)>
The comparison delegate used to compare items in the collection.

Return Value

An array containing the sorted version of the collection.

Type Parameters

T

Remarks

Values are compared by using the IComparable<T> interfaces implementation on the type T.

See Also